package com.itHsuSE.demo12;

/**
 * @author Hsu琛君珩
 * @ClassName:Main
 * @date 2024-01-26
 * @apiNote
 * @Version: v1.0
 */

import java.util.*;

public class Main {
    static int[] father;
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int t = sc.nextInt();
        while(t-->0){
            double x1=sc.nextDouble();
            double y1=sc.nextDouble();
            double x2=sc.nextDouble();
            double y2=sc.nextDouble();
            double x3=sc.nextDouble();
            double y3=sc.nextDouble();
            double S=Math.abs(x1*y2+x2*y3+x3*y1-x1*y3-x2*y1+x3*y2);
            double L=Math.sqrt((x1-x2)*(x1-x2)+(y1-y2)*(y1-y2));
            System.out.printf("%.2f",S/L);
            System.out.println();
        }
    }
}